import {createRouter, createWebHistory} from 'vue-router'

const router = createRouter({
    history: createWebHistory(import.meta.env.BASE_URL),
    routes: [
        {
            path: '/',
            name: 'login',
            component: () => import('../views/login.vue')
        },
        {
            path: "/admin",
            name: "admin",
            component: () => import('../views/admin/Admin.vue'),
            children: [
                {
                    name: "staff",
                    path: "/permission/staffManagement",
                    component: () => import('../views/admin/permission/StaffManagemet.vue')
                },
                {
                    name: "menu",
                    path: "/menu/list",
                    component: () => import('../views/admin/permission/Menu.vue')
                },
                {
                    name: "role",
                    path: "/index/roles",
                    component: () => import('../views/admin/permission/Role.vue')
                },
                {
                    name: "station",
                    path: "/station/list",
                    component: () => import('../views/busi/station/Index.vue')
                }, {
                    name: "gun",
                    path: "/station/charge/list",
                    component: () => import('../views/busi/station/Gun.vue')
                },
                {
                    name: "alarm",
                    path: "/alarm/list",
                    component: () => import('../views/busi/alarm/Index.vue')
                },
                {
                    name: "coupon",
                    path: "/coupon/list",
                    component: () => import('../views/busi/coupon/Index.vue')
                },
                {
                    name: "couponQuery",
                    path: "/couponQuery/list",
                    component: () => import('../views/busi/couponQuery/Index.vue')
                },
                {
                    name: "exchangeCode",
                    path: "/exchange/code/list",
                    component: () => import('../views/busi/exchangeCode/Index.vue')
                },
                {
                    name: "chargingUser",
                    path: "/charging/user/list",
                    component: () => import('../views/busi/charging/User.vue')
                },
                {
                    name: "ChargingInvestor",
                    path: "/investor/user/list",
                    component: () => import('../views/busi/charging/Investor.vue')
                },
                {
                    name: "ChargingOrder",
                    path: "/charging/order/list",
                    component: () => import('../views/busi/charging/Order.vue')
                },
                {
                    name: "PayOrder",
                    path: "/charge/pay/order/list",
                    component: () => import('../views/busi/charge/PayOrder.vue')
                },
                {
                    name: "RefundOrder",
                    path: "/charge/refund/order/list",
                    component: () => import('../views/busi/charge/RefundOrder.vue')
                },
                {
                    name: "index",
                    path: "/permission/index",
                    component: () => import('../views/index.vue')
                },
                {
                    name: "car",
                    path: "/index/sys/car",
                    component: () => import('../views/busi/car/chargeCar.vue')
                },
                {
                    name: "ChargeCoreInfo",
                    path: "/index/sys/site",
                    component: () => import('../views/busi/core/ChargeCoreInfo.vue')
                },
                {
                    name: "ChargeMarkey",
                    path: "/index/sys/coupon",
                    component: () => import('../views/busi/market/ChargeMarkey.vue')
                },
                {
                    name: "users",
                    path: "/index/users",
                    component: () => import('../views/admin/permission/StaffManagemet.vue')
                },
                {
                    name: "userException",
                    path: "/index/sysJob",
                    component: () => import('../views/exception/UserException.vue')
                },
                {
                    name: "GiftManager",
                    path: "/index/sys/active",
                    component: () => import('../views/gift/GiftManager.vue')
                },
                {
                    name: "AdminLog",
                    path: "/index/logs",
                    component: () => import('../views/admin/log/AdminLog.vue')
                },
                {path: '', redirect: '/permission/index'}
            ]
        },
        {
            path: '/about',
            name: 'about',
            component: () => import('../views/AboutView.vue')
        }
    ]
})

export default router
